home *** CD-ROM | disk | FTP | other *** search
- property RedBoxSprite, PropLeftEdge, PropTopEdge, PropRightEdge, PropBottomEdge, oldLeft, oldTop, oldRight, oldBottom, BoxMoveCount, spriteNum
-
- on getPropertyDescriptionList
- description = [:]
- addProp(description, #RedBoxSprite, [#default: -1, #format: #number, #comment: "Red Box Sprite:"])
- addProp(description, #PropLeftEdge, [#default: -1, #format: #number, #comment: "Left Edge:"])
- addProp(description, #PropTopEdge, [#default: -1, #format: #number, #comment: "Top Edge:"])
- addProp(description, #PropRightEdge, [#default: -1, #format: #number, #comment: "Right Edge:"])
- addProp(description, #PropBottomEdge, [#default: -1, #format: #number, #comment: "Bottom Edge:"])
- return description
- end
-
- on beginSprite me
- BoxMoveCount = 0
- oldLeft = sprite(RedBoxSprite).left
- oldTop = sprite(RedBoxSprite).top
- oldRight = sprite(RedBoxSprite).right
- oldBottom = sprite(RedBoxSprite).bottom
- end
-
- on exitFrame me
- steps = 15
- if BoxMoveCount < steps then
- BoxMoveCount = BoxMoveCount + 1
- dLeft = oldLeft + (((1.0 * PropLeftEdge) - oldLeft) / steps * BoxMoveCount)
- dTop = oldTop + (((1.0 * PropTopEdge) - oldTop) / steps * BoxMoveCount)
- dRight = oldRight + (((1.0 * PropRightEdge) - oldRight) / steps * BoxMoveCount)
- dBottom = oldBottom + (((1.0 * PropBottomEdge) - oldBottom) / steps * BoxMoveCount)
- sprite(RedBoxSprite).locH = dLeft
- sprite(RedBoxSprite).locV = dTop
- sprite(RedBoxSprite).width = dRight - dLeft
- sprite(RedBoxSprite).height = dBottom - dTop
- else
- sprite(RedBoxSprite).locH = PropLeftEdge
- sprite(RedBoxSprite).locV = PropTopEdge
- sprite(RedBoxSprite).width = PropRightEdge - PropLeftEdge
- sprite(RedBoxSprite).height = PropBottomEdge - PropTopEdge
- end if
- end
-